package request

import "tg-bot/common"

type Result struct {
	Code      int         `json:"code"`
	Msg       string      `json:"msg"`
	Data      interface{} `json:"data"`
	TimeStamp int64       `json:"time_stamp"`
}

func ResponseOK(data interface{}) Result {
	return Result{
		Code:      200,
		Msg:       "Success",
		Data:      data,
		TimeStamp: common.START_TIME,
	}
}
func ResponseOKWithCode(code int, data interface{}) Result {
	return Result{
		Code:      code,
		Data:      data,
		Msg:       "Success",
		TimeStamp: common.START_TIME,
	}
}
func ResponseOKWithMsg(code int, msg string, data interface{}) Result {
	return Result{
		Code:      code,
		Data:      data,
		Msg:       msg,
		TimeStamp: common.START_TIME,
	}
}
func ResponseError(code int, msg string) Result {
	return Result{
		Code:      code,
		Msg:       msg,
		TimeStamp: common.START_TIME,
	}
}
func ResponseErrorWithCode(msg string) Result {
	return Result{
		Code:      -1,
		Msg:       msg,
		TimeStamp: common.START_TIME,
	}
}
